/*    */ package cc.s2m.web.s2mBlog.freemarker;
/*    */ 
/*    */ import cc.s2m.web.s2mBlog.pojo.ArticlesTags;
/*    */ import cc.s2m.web.s2mBlog.pojo.Tags;
/*    */ import cc.s2m.web.s2mBlog.service.IArticlesTags;
/*    */ import cc.s2m.web.s2mBlog.service.ITags;
/*    */ import com.google.common.collect.Lists;
/*    */ import freemarker.template.SimpleNumber;
/*    */ import freemarker.template.TemplateMethodModelEx;
/*    */ import freemarker.template.TemplateModelException;
/*    */ import java.util.List;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ 
/*    */ public class ArticleTag
/*    */   implements TemplateMethodModelEx
/*    */ {
/*    */ 
/*    */   @Autowired
/*    */   private ITags tagsService;
/*    */ 
/*    */   @Autowired
/*    */   private IArticlesTags articlesTagsService;
/*    */ 
/*    */   public Object exec(List arguments)
/*    */     throws TemplateModelException
/*    */   {
/* 25 */     List tagList = Lists.newArrayList();
/* 26 */     if ((arguments == null) || (arguments.size() < 1)) {
/* 27 */       return tagList;
/*    */     }
/* 29 */     SimpleNumber number = (SimpleNumber)arguments.get(0);
/* 30 */     int aid = number.getAsNumber().intValue();
/* 31 */     ArticlesTags atVo = new ArticlesTags();
/* 32 */     atVo.setAid(Integer.valueOf(aid));
/* 33 */     List<ArticlesTags> atlist = this.articlesTagsService.getList(atVo, null);
/* 34 */     for (ArticlesTags atBean : atlist) {
/* 35 */       Tags tagBean = (Tags)this.tagsService.selectByPrimaryKey(atBean.getTid());
/* 36 */       if (tagBean != null) {
/* 37 */         tagList.add(tagBean);
/*    */       }
/*    */     }
/* 40 */     return tagList;
/*    */   }
/*    */ }

/* Location:           C:\Users\Administrator\Desktop\s2mBlog.zip
 * Qualified Name:     s2mBlog-3.0.0.WEB-INF.classes.cc.s2m.web.s2mBlog.freemarker.ArticleTag
 * JD-Core Version:    0.6.1
 */